/*
 * @Author: your name
 * @Date: 2021-10-06 11:25:38
 * @LastEditTime: 2021-10-06 11:33:59
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \luogu\1.2排序\P1059\main.cpp
 */
#include<iostream>
using namespace std;

const int MAX_NUM = 1001;

int main(){
  //随机数数目
  int num;
  cin >> num;
  int input;
  //记录每个学号出现的次数
  int findNUm[MAX_NUM];
  for(int i=1; i<MAX_NUM; i++){
    findNUm[i] = 0;
  }
  //记录学生总数
  int stu_num = 0;
  //输入随机数
  for(int i=0; i<num; i++){
    cin >> input;
    //当前学生未被记录
    if(findNUm[input] == 0){
      findNUm[input]++;
      stu_num++;
    }
  }
  //输出
  cout << stu_num << endl;
  for(int i=1; i<MAX_NUM; i++){
    if(findNUm[i]) cout << i << " ";
  }
  return 0;
}
